﻿<controls:ChildWindow xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"  xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="ATSV.Views.AdminCockpit"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="800" Height="500" 
           Title="Administrator's Cockpit" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:my="clr-namespace:ATSV.Web" xmlns:my1="clr-namespace:ATSV.Web.Services">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <sdk:TabControl Grid.Row="0">
            <sdk:TabItem Header="General">
                
            </sdk:TabItem>
            <sdk:TabItem Header="News">
                <Grid>
                    <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:NewsItemSet, CreateList=true}" Height="0" LoadedData="newsItemSetDomainDataSource_LoadedData" Name="newsItemSetDomainDataSource" QueryName="GetNewsItemSetsQuery" Width="0">
                        <riaControls:DomainDataSource.DomainContext>
                            <my1:ATSVDataContext />
                        </riaControls:DomainDataSource.DomainContext>
                    </riaControls:DomainDataSource>
                    <Grid DataContext="{Binding ElementName=newsItemSetDomainDataSource, Path=Data}" HorizontalAlignment="Left" Margin="12" Name="grid1" VerticalAlignment="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>


                        <sdk:Label Content="Titel:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                        <TextBox Grid.Column="1" Grid.Row="0" Height="23" HorizontalAlignment="Left" Margin="3" Name="titelTextBox" Text="{Binding Path=Titel, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="500" />
                        
                        <sdk:Label Content="Body:" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Top" />
                        <TextBox Grid.Column="1" Grid.Row="1" Height="100" HorizontalAlignment="Left" Margin="3" Name="bodyTextBox" Text="{Binding Path=Body, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="500" />
                        
                        <sdk:Label Content="Link:" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                        <TextBox Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="3" Name="linkTextBox" Text="{Binding Path=Link, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="500" />
                        
                    </Grid>
                    <Button Content="Speichern" Height="23" HorizontalAlignment="Left" Margin="442,182,0,0" Name="speichernButton" VerticalAlignment="Top" Width="112" Click="speichernButton_Click" />
                    <Button Content="Verwerfen" Height="23" HorizontalAlignment="Left" Margin="319,182,0,0" Name="verwerfenButton" VerticalAlignment="Top" Width="112" Click="verwerfenButton_Click" />
                </Grid>
            </sdk:TabItem>
            <sdk:TabItem Header="Spieler und Teams">
                <Grid>
                    <sdk:Label Height="28" HorizontalAlignment="Left" Margin="6,6,0,0" Name="label1" VerticalAlignment="Top" Width="167" Content="Spieler hinzufügen" FontSize="16" />
                    <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:SpielerSet, CreateList=true}" Height="0" LoadedData="spielerSetDomainDataSource_LoadedData" Name="spielerSetDomainDataSource" QueryName="GetSpielerSetsQuery" Width="0">
                        <riaControls:DomainDataSource.DomainContext>
                            <my1:ATSVDataContext />
                        </riaControls:DomainDataSource.DomainContext>
                    </riaControls:DomainDataSource>
                    <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:TeamSet, CreateList=true}" Height="0" LoadedData="teamSetDomainDataSource_LoadedData" Name="teamSetDomainDataSource" QueryName="GetTeamSetsQuery" Width="0">
                        <riaControls:DomainDataSource.DomainContext>
                            <my1:ATSVDataContext />
                        </riaControls:DomainDataSource.DomainContext>
                    </riaControls:DomainDataSource>
                    
                    <sdk:DataGrid AutoGenerateColumns="False" Height="207" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=spielerSetDomainDataSource, Path=Data}" Margin="6,40,0,0" Name="spielerSetDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="754">
                        <sdk:DataGrid.Columns>
                            <sdk:DataGridTextColumn x:Name="idColumn" Binding="{Binding Path=Id, Mode=OneWay}" Header="Id" IsReadOnly="True" Width="SizeToHeader" />
                            <sdk:DataGridTextColumn x:Name="jahrgangColumn" Binding="{Binding Path=Jahrgang}" Header="Jahrgang" Width="SizeToHeader" />
                            <sdk:DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=Name}" Header="Name" Width="SizeToHeader" />
                            <sdk:DataGridTextColumn x:Name="teamIdColumn" Binding="{Binding Path=TeamId}" Header="Team Id" Width="SizeToHeader" />
                            <sdk:DataGridTextColumn x:Name="vornameColumn" Binding="{Binding Path=Vorname}" Header="Vorname" Width="SizeToHeader" />
                            <!--sdk:DataGridTemplateColumn x:Name="teamNameColumn">
                                <sdk:DataGridTemplateColumn.CellEditingTemplate>
                                    <DataTemplate>
                                        <ComboBox DisplayMemberPath="Name" Grid.Column="1" Height="23" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=teamSetDomainDataSource, Path=Data}" Margin="0,0,0,6" Name="nameComboBox" VerticalAlignment="Center" Width="120">
                                            <ComboBox.ItemsPanel>
                                                <ItemsPanelTemplate>
                                                    <VirtualizingStackPanel />
                                                </ItemsPanelTemplate>
                                            </ComboBox.ItemsPanel>
                                        </ComboBox>
                                    </DataTemplate>
                                </sdk:DataGridTemplateColumn.CellEditingTemplate>
                            </sdk:DataGridTemplateColumn-->
                        </sdk:DataGrid.Columns>
                    </sdk:DataGrid>
                    
                    
                </Grid>
            </sdk:TabItem>
        </sdk:TabControl>
        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>